CUBE CONNECT Edition Help

Phases

You code Highway-program control statements within different phases. The Highway program processes the phases in a specific order.

This section provides more details about the different phases in the Highway program:

SETUP phase

After reading all control statements, the Highway program processes the SETUP phase’s control statements—that is, its stack. The SETUP phase can only contain COMP and SET statements. The SETUP phase does not have a header: it precedes the first actual PHASE= statement. Use the SETUP phase to initialize certain variables and/or arrays.

LINKREAD phase

An initial LINKREAD phase follows the SETUP phase. This phase obtains the required initial values from the input network and computes link values that you can reference in other phases. The program executes the LINKREAD phase implicitly during the equilibrium/volume-combination process and during the ADJUST phase to obtain required link values from the input network.

You reference values obtained directly from the network with the network variable name prefixed by "LI." Link variables not obtained directly from the network are called link-work variables. To reference link-work variables, you must give link-work variables names that begin with "LW." For example, the statement: LW.TOLLTIME=LI.TOLLTIME/100 generates a value available for every link at any phase in the program. On the other hand, the statement: TOLLTIME=LI.TOLLTIME/100 generates a temporary variable that has no meaning beyond the current link. The program stores link-work variables as link-work arrays. See Built-in arrays.

Note: Please see Using Cluster with HIGHWAY for guidelines on using link-work arrays in a distributed system.

During the LINKREAD phase, the program processes an internal loop from the first link through the last link, using the LINKNO variable (that is, LINKNO=1, NUMLINKS). For each value of LINKNO, the program obtains a link data record from the input network (NETI), and processes any control statements (the LINKREAD stack).

In the LINKREAD stack, you might use:

  • COMP statements to alter, or set, link values.

  • PRINT statements to list information about individual links. Remember that DISTANCE, LINKCLASS, C, T0, T1, TIME, COST, and DIST contain meaningless values during LINKREAD processing.

Note: The program processes the entire LINKREAD stack for each link whenever reading a network link’s data record. To ensure consistency, the program also processes the LINKREAD stack for each link when reading and processing the link in the ADJUST (capacity restraint) phase. Therefore, you must not reference DISTANCE, LINKCLASS, C, T0, T1, TIME, COST, and DIST in the LINKREAD stack; doing so could alter the internal arrays used and dynamically altered by the capacity-restraint process.

If you do not need any special LINKREAD operations, you need not specify any stack statements in this phase.

After processing the LINKREAD stack, the program ensures that certain link variables (T0, T1, and C) have values and sets the link’s TIME, COST, and DIST values. There are several methods for setting these variables. See Setting TIME, COST, and DIST values.

Note: The program does not set the TIME, COST and DIST values after processing the LINKREAD stack for each link during the capacity-restraint process (that is, during the ADJUST phase).

You can use the LINKREAD phase to specify GROUP codes for links. You might use GROUP codes for various reasons. For example, you can disable links with certain GROUP code values during path building to preclude using those links in the path. See PATHLOAD for more details. For example, you might build low- occupancy vehicle paths by precluding the use of HOV links. Other applications can also take advantage of this capability.

GROUP codes can be very useful in select-link processing. You can easily identify paths that use links with certain GROUP codes, and use these paths for extracting matrices. You can even identify the paths that have a certain level, or combination of levels, of GROUP- coded links. See SETGROUP for details.

Setting TIME, COST, and DIST values

After processing the LINKREAD stack, the program sets TIME, COST, and DIST values using the following logic:

  • DISTANCE (possibly used to compute T0):

    • If set by LINKREAD stack, use that value.

    • Else if there is a LI.DISTANCE, set DISTANCE = LI.DISTANCE.

    • Else set DISTANCE = 0.

    • If DISTANCE < 0, set DISTANCE = 0.

  • LINKCLASS (essential for selecting appropriate Functions):

    • If set by LINKREAD stack, use that value.

    • Else if there is a LI.LINKCLASS, set LINKCLASS = LI.LINKCLASS.

    • Else set LINKCLASS = 1.

    • If LINKCLASS < 1, set LINKCLASS = 1.

  • SPEED (possibly used to compute T0):

    • If set by LINKREAD stack, use that value.

    • Else if there is a LI.SPEED, set SPEED = LI.SPEED.

    • Else If there are LI.LANES and LI.SPDCLASS and their values are valid (1-9, and 1-99), set

    • SPEED = SPEEDFOR(LI.LANES,LI.SPDCLASS).

    • Else set SPEED = 0.

  • C (capacity, used later in restraining process in the ADJUST phase):

    • If set by LINKREAD stack, use that value.

    • Else if there is a LI.CAPACITY, set C = LI.CAPACITY* CAPFAC.

    • Else If there are valid LI.LANES and LI.CAPCLASS values (1-9 and 1-99), set C = CAPACITYFOR(LI.LANES,LI.CAPCLASS) * CAPFAC.

    • Else set C = 0.

    • If C < 0, set C = 0.

      Note: The program treats a link capacity of 0 (zero) as infinite capacity.

  • T0 (free flow time):

    • If set by LINKREAD stack, use that value.

    • Else if there is a LI.T0, set T0=LI.T0.

    • Else if there is a LI.TIME, set T0 = LI.TIME.

    • Else if there is a LI.TIME1, set T0 = LI.TIME1.

    • Else if SPEED > 0, set T0 = DISTANCE*60/SPEED.

    • If T0 < 0, set T0 = 0.

  • T1 (initial iteration time):

    • If set by LINKREAD stack, use that value.

    • Else set T1 = T0.

  • TIME (a link-work variable, without the required "LW." prefix, of T1 values):

    • Set equal to T1. Do not reference TIME in LINKREAD stack because its value is unpredictable during stack processing.

  • COST (a link-work variable, without the required "LW." Prefix, of cost values):

    • Compute from the COST function for the LINKCLASS. Do not reference COST in LINKREAD stack.

  • DIST (a link-work variable, without the required "LW." prefix, of DISTANCE values):

    • Set equal to DISTANCE. Do not reference DIST in LINKREAD stack.

Note: Though the program examines DISTANCE and SPEED, you need not specify them. Usually, the program computes T0 by dividing DISTANCE by SPEED. Therefore, the program will try to obtain DISTANCE and SPEED values. If you do not set these values in control statements, the program will try to set them, and then compute T0. On the other hand, if you set T0 directly, the program does not use the values of DISTANCE and SPEED.

ILOOP phase

The ILOOP phase performs a zonal loop (I = 1, Zones). This phase is the first phase of the iteration loop (:ITERATION=1, :LASTITERATION). Almost all control statements are valid during the ILOOP phase (that is, in the ILOOP stack). The Highway program requires a PHASE=ILOOP statement, and the ILOOP stack must have at least one PATHLOAD statement. The program executes the ILOOP stack one time for each value of I.

The ILOOP stack can contain nearly any of the functions of the Matrix program. The ILOOP phase performs MW[#] statements for all Js (J=1, Zones), unless the statement occurs within a JLOOP block, or the statement specifies both indices (MW[m][j]).

Please see: "Using Cluster with HIGHWAY" for guidelines on using link-work arrays in the ILOOP phase.

For assignment, you must include a PATHLOAD statement. This statement specifies a set of values that the program assigns to the links in a specified path set. The following examples illustrate the PATHLOAD statement:

Volume sets

A volume set is an array that accumulates assignments for each link. There may be up to 1000 volume sets. Though the highest set number is 1000, set numbering need not be monotonic. The program refers to volume sets as VOL[#], and clears each at the beginning of each iteration. You can enter values into volume sets with PATHLOADVOL[#]= expressions. A VOL[#] expression implies an internal loop of J=1, ZONES. In example 1, VOL[1]=MI.1.6 instructs the program to assign the values from the expression "MI.1.6" to each link in the paths from the origin zone (I) to each of the destination zones (J). As J loops, the value (normally trips) for I to J from MI.1.6 will be assigned to links along the path from I to J.

Example 1

PATHLOAD VOL[1]=MI.1.6, PATH=TIME

Builds paths based on TIME value. For each link in those paths, adds values to the first volume set (VOL[1]) from matrix 6 in the MATI[1] file.

Example 2

PATHLOAD PATH=LI.DISTANCE, VOL[3]=I*10+J

Builds paths based on the value of DISTANCE read from the network. For each link in those paths, adds values to the third volume set (VOL[3]) computed from the"I*10+J" expression. (The program assigns a value for each J in: J=1, ZONES.)

Example 3

PATHLOAD VOL[4]=MW[5]+MW[6]+MI.2.8, PATH=LW.TOLLTIME

Builds paths based on the link-work variable, TOLLTIME. For each link in those paths, adds values to the fourth volume set (VOL[4]) computed from the "MW[5] + MW[6] + MI.2.8" expression.

Stratifying vehicle distance traveled by average trip speed

During a multiple-iteration assignment, the trips from any I to J may use various paths. The paths are based upon the link times in effect during that iteration. After all iterations, the program determines vehicle time from the final link volumes and the travel times associated with those volumes. You might want to estimate emissions based on the average trip speed rather than on the individual link volumes, distances, and times. In this case, you must request REPORT VDTSPD to base vehicle distance on average trip speed.

This option requires considerably more processing and might require considerably more disk space. The program saves the paths for each I-J movement during normal assignment. Following the assignment, the program retrieves the paths and retraces all the assigned trips along their paths. The program uses the final link times to compute the individual trip time and distance. Finally, the program calculates the average speed for the trip. The program uses speed to stratify the vehicle distance of travel.

You can specify multiple stratification schemes; additional schemes do not require additional resources.

Select-link processing

Use the PATHLOAD statement to initiate select-link processing. The PATH keyword specifies the link values that the program uses to develop the paths. Specify an MW[ ] expression followed by SELECTLINK, SELECTGROUP, or SELECTLINKGROUP to solve the MW expression only for those destination zones (J) where the specified SELECT… expressions result in a true condition. Subsequent VOL[ ] statements can assign any of the select-link matrices to a link’s volume set. Select link functionality is currently not implemented with path based assignment (COMBINE=PATH) and will not work.

Example (simple code – inefficient)

MW[1]=0
JLOOP ; this illustrates selective gathering
IF ((I=... & J=...) || (I=... & J=...) ) MW[1] = MI.1.1
ENDJLOOP
VOL[1]=MW[1],path=...

Solving complicated selections is time consuming. The IF process will run faster if the zonal ranges are not too complicated.

Example (most efficient)

IF(I=...)PATH=...,VOL[1]=MI.1.1,INCLUDEJ=...

Example (using SELECTLINK)

PATH=..., MW[1]=MI.1.ODTRIPS, SelectLink=(a=... && b=...),
   SelectLink=(a=... && b=...),
VOL[1]=MI.1.1,

Selected zone loading

You can use several techniques to load only trips between selected zone pairs:

  • Establish a work matrix with the trips you want loaded. Clear the "unwanted" I-J pairs, and then reference that matrix with the PATHLOAD VOL[ ] statement.

  • Use IF statements to find the desired I, and use INCLUDEJ and EXCLUDEJ keywords to select the desired J values.

  • Use SELECTLINK, specifying A=range of desired I values and B=range of desired J values.

Subarea trip extraction

To obtain matrices of trips that travel through some portion of a selected region in the network (such as a subarea network polygon), use the following keywords: + FILEI SUBAREANETI - Define the region. + FILEO SUBAREAMATO - Define where to save the selected trips. + PATHLOAD SUBAREAMAT - Specify values to write to the SUBAREAMATO file.

After building paths for the current I-zone, the program computes the SUBAREAMAT expression for each J-zone on the path from I to J. If the I-to-J path uses any links in the subarea network, the program records the computed value for the path’s J in the subarea matrix. This process can extract several types of records:

Potential extracted records

  • X-X - Path begins and ends outside subarea, crossing the cordon line exactly two times.

  • X-I - Path begins outside the subarea and ends inside the subarea.

  • I-X - Path begins inside the subarea and end outside the subarea.

  • I-I - Path begins and ends inside the subarea.

When a path enters the subarea by crossing a cordon link, the A- node of the cordon link becomes the origin zone of the extracted record. Similarly, the B-node of the cordon link used to exit the subarea becomes the destination zone. If the path terminates at an internal zone, the internal zone becomes the destination zone.

When a path exits the subarea, the internal zone where the path began, or the A node of the cordon link that was used to enter the subarea, becomes the origin zone of the extracted record, and the B node of the exit cordon link becomes the destination zone.

If a path begins and ends inside the subarea, but never crosses the cordon line, a single I-I record is extracted. The A node of the origin zone becomes the origin, and the destination zone becomes the destination. The intrazonal value for an internal zone will be extracted even though there is no path.

Multiple records can be extracted for a path. (For example, a path begins outside, enters, exits, enters, and either exits again, or terminates an internal zone.) The final matrices are combined values from all iterations of assignment, but if requested during a non-assignment application, only 1 iteration is processed.

The subarea network is obtained from CUBE Base, using the polygon subarea network extraction process.

Example (subarea trip extraction)

PATHLOAD PATH=TIME, SUBAREAMAT[1]=MI.1.1, SUBAREAMAT[2]=1

ADJUST phase

You may skip ahead to:

Part of the iteration loop, the ADJUST phase automatically follows the ILOOP phase. This phase computes the congested time (Tc) on each link and revises the link’s TIME values, which the next iteration uses.

If you want to complete special processing on each link following the normal adjustment process, include the Phase=ADJUST control statement followed by the stack of control statements you want to complete. Most commonly, you might include ADJUST statements to list how the normal adjustment process affects each link and to adjust LW values. LW values based on values revised by the ADJUST process (such as TIME and COST) should be recalculated. For example, if you have a set of LW.TOLLTIME values, those values must be updated to reflect changes made in TIME. You must make the changes to LW.TOLLTIME because the program does not know your intention and cannot adjust the values automatically. Though allowed, Bentley recommends that you do not alter TIME values with ADJUST statements.

After processing user-specified ADJUST statements, the program recalculates the COST values using the Cost Function. See FUNCTIONCOST for more on using cost functions.

The ADJUST phase runs an automatic link loop across all links on the input network. The link loop executes the ADJUST phase stack once per link. To accumulate summary values during the link loop, you must properly initialize the values at the beginning of the link loop. In initializing statements, you might test the value of LINKNO:IF(LINKNO=1)... (You can also test for ITERATION and LASTITERATION.)

Congestion is based on the variable V, computed for each link. By default, V is the sum of all VOL[ ] values that appear on any PATHLOAD statement. Use a FUNCTIONV statement to override the default computation of V.

When using SELECTLINK analysis:

  • Do not use the default computation for V if you configure a standard assignment along with a select-link assignment; this configuration duplicates some volumes. Use a FUNCTIONV statement to override the default computation of V.

  • With SELECTLINK analysis, only the turn volume sets corresponding to the original volume indices should be summed. This avoids double counting in the TURNS request.

    For example, when

    FUNCTIONV = VOL[1] + VOL[2]

    Then the corresponding TURNS request should be:

    TURNST = TURN[1] + TURN[2]

    For more information, please see TURNS.

Note: See Functions and built-ins for a description of the built-in functions, variables, and arrays the program uses.)

Most often, you configure multiple iterations, and the program computes the final volumes by combining the volumes from each iteration. Though you can specify the maximum number of iterations, Bentley recommends that you let the program determine when more iterations will not result in any assignment improvements.

The program can use various methods to combine iteration volumes. Use PARAMETERS COMBINE to specify the method used. For a list of these methods, see Combination processes.

Equilibrium assignment is performed within the ADJUST phase. If the term assignment is used to indicate the actual accumulation of trips on link volumes, the term "equilibrium assignment" is somewhat of a misnomer. Most users tend to think of equilibrium assignment as the process of determining a weight factor for an iteration, and then applying that factor to the current iteration volumes and a complementary factor to the previously weighted volumes to obtain new weighted volumes. If the network is "well behaved," and the appropriate processes are included, eventually a state of equilibrium is reached. That state is reached when further adjustments in the link costs used for routing, will not produce significant differences in the system as a whole. In theory, equilibrium is reached when there is no ability for individual I-J path costs to improve, without causing degradation in other parts of the network. If a system has a significant degree of congestion, it may be difficult (practically impossible) to reach a true state of equilibrium.

The basic measure of equilibrium is total system user cost, and in most situations, cost involves some measure of time. Time is generally the measurable quantity that can be directly related to congestion. Thus, most equilibrium formulations are based upon time. To determine the weight to apply to each iteration’s volume in the volume combining process, a factor λ (generally referred to as Lambda) is estimated for the iteration. Lambda is a factor >=0 and < 1. Starting from CUBE 6.4 version, LAMBDA has been allowed to take zero values. This is controlled by the PARAMETER ALLOWLAMBDA0. By default ALLOWLAMBDA0 is set to true. Once LAMBDA reaches zero, the assignment process stops since there will be no more convergence of the results. It is impossible to solve directly for Lambda, so it is estimated using a linear approximation method.

The user can select one of two Lambda search processes using the PARAMETERS COMBINELAMBDASEARCH = AREA, or EQUATION. Note that both processes estimate Lambda so the results might be slightly different. In most cases, the results will be quite similar, but the EQUATION method can save considerable computation and I/O time.

  • If the AREA search process is used, the program minimizes the area under all the V vs. Cost curves computed for incremental estimates of lambda for every link. This process provides a Lambda calculation that is up to 6 digits in precision.

    If a standard function for computing TC is used, the estimation process could be considerably more efficient.

  • If the EQUATION search process is used, the program solves the expression for only a limited number of Lambdas, using the following expression if the default BPR form is used for the TC functions or no TC functions are coded (default TC function is BPR form with default BPR constant and exponent):

(1)

where:

  • = the summation over the links in the input network

  • VOLk = the AON volume assigned in iteration k to COSTk-1 paths based on Vk-1

  • Vk-1 = the equilibrium weighted volume from the prior iteration

  • T0 = the free flow time

  • TCCOEFF = value of the TC functions coefficient term defined on the PARAMETERS statement

  • C = the link capacity

  • TCEXP = value of the TC functions exponent term defined on the PARMETERS statement

If the user has specified his own alternate form for the TC functions using the PARAMETERS TCCOEFF and TCEXP and requests the EQUATION search process, then the program uses the following expression to solve for Lambda:

(2)

Where TC(V’,TCCOEFF,TCEXP) is the TC functions evaluated for link volumes V’, and the appropriate values of TCCOEFF and TCEXP, where .

The resulting curve is examined, and the Lambda which provides Y=0 is obtained by interpolation. This value is then used to weight the current volumes:

Note: EQUATION is available only with the single user class assignment, and when using the default FUNCTION COST=TIME. On the other hand, with a generalized cost function, only the AREA process should be used. This is depicted in Example 8: Multiple User Class Assignment with Cost based on User Class. EQUATION and AREA will generate substantially different results when used with a generalized cost function.

Example illustrating Lambda and Factor

To illustrate the relationship between Lambda and Factor, below is a sample assignment with three iterations:

From the previous section,

Combining these,

Where

These relationships thus yield:

Iteration Lambda Factor
0 1 0.43207
1 0.32084 0.20411
2 0.36381 0.36381

Combination processes

There are several iteration volume combination processes available; the PARAMETERS COMBINE= specifies the one to use. EQUI is the default. The available processes are:

EQUI

Standard equilibrium processing: compute a Lambda () for each iteration to be applied to obtain the factor to combine the current volume (V) with the previous combined volume (CVOL):

This method is an implementation of the Frank-Wolfe algorithm (“An algorithm for quadratic programming”, Naval Research Logistics Quarterly, 3 (1956), pp. 95-110).

Note: Highway will use TIME as the cost for the computation of Lambda, unless FUNCTION COST is calculated in the Highway model.

With this method, there are several options that can be specified by the subkeyword LAMBDASEARCH. When intersection modeling is being undertaken (triggered by the presence of a FILEI JUNCTIONI statement), standard Lambda estimation processes are used for the link volume evaluations, but there is no equivalent process for including turning volumes. Intersection delays are not directly dependent upon the volumes on them; they are influenced by the total intersection traffic. But, the delays might have an important impact upon the assignment convergence. The vehicle delay costs for the turn movement can be included with the link costs by providing a value for the EQUITURNCOSTFAC keyword. If specified, Lambda estimation includes the turning delays multiplied by this value.

HIGHWAY supports additional assignment algorithms for COMBINE=EQUI mode. To access these, include the ENHANCE keyword immediately after the COMBINE=EQUI statement. Please see ENHANCE.

When using COMBINE=EQUI, please note that:

  • For distributed cluster node systems, please see Using Cluster with HIGHWAY.

  • Any LW.xxxx equation containing variables which are a function of Volume changes (such as TIME) cannot be used with FUNCTION COST and FUNCTION TC when COMBINE=EQUI. Such arrays are updated following the equilibrium processes in the ADJUST phase, and will generate incorrect results if directly referenced.

    For an implementation example, Bentley strongly recommends reviewing Multiple user class assignment using generalized cost functions.

AVE

Averages all the iteration loadings — the program simply keeps a running average of the volumes on each link.

WTD

Weighted average. MAXITERS will be set according to the number of weights specified in WEIGHTS. This is similar to AVE, but the required weights are used to favor specific iterations.

ITE

Iterative assignment keeps only last iteration volumes as output; prior iteration volumes are not considered. Only the last iteration volumes are used for output to NETO.

SUM

All the Iteration volumes are summed to form the final volume. This process can be used to perform traditional incremental loading. When SUM is specified, it must be followed by the FRACTIONS subkeyword. The V at the end of each iteration is the accumulated V for all the iterations to that point. Thus, the V/C ratio used in adjustment is based upon a partial assignment; it is true only on the last iteration. If it is desired to use a “projected full” V/C, then C must be computed differently depending upon which iteration it is. This can be accomplished in the LINKREAD phase, by use of IF (ITERATION=…) processes or by using an array of C scales.

PATH

HIGHWAY includes support for path-based assignment using a gradient projection algorithm. In contrast to the Frank-Wolfe method (which finds solutions that are vertices of the feasible region), gradient projection makes successive moves in the direction of negative gradient.

The keywords VARIABLEDEMAND and ALLJ can be included immediately after the COMBINE=PATH statement, which gives additional flexibilities to handle complex scenarios. For more information, see VARIABLEDEMAND.

With path based assignment, select link functionality is not implemented and will not work.

PROBIT and BURRELL

See also Stochastic traffic assignment theory.

These COMBINE modes support stochastic assignment.

Associated COMBINE sub-keywords supporting stochastic assignment (when using PROBIT and BURRELL) are:

The associated PATHLOAD statement stochastic assignment support keywords are:

PATH=x, SPREADPERC=n, SPREADPERCVAR=var, SPREADMAX=n

Convergence tests

If the optional CONVERGE phase has not been specified then default convergence testing is performed at the end of the ADJUST phase to determine if more iterations are necessary.

Convergence testing is not performed for Combine=Sum assignment. There are several tests that can be made to determine if more iterations are necessary. The items that are used in the tests are Keywords set with the PARAMETERS statement and include:

  • GAPk - ABS(SUML(VEk*COSTEk) – SUML(Vk-1*COSTEk-1))/ SUML(Vk-1*COSTEk-1)

    Where k is the current iteration and SUML denotes summation over the links and, if appropriate, the turning movements in the network, VEk is the equilibrium weighted volumes for iteration k and COSTEk is the cost based on the equilibrium volumes VEk.

  • RGAPk - SUML(VEk-1*COSTEk-1) - SUML(VAk*COSTEk-1))/ SUML(VEk-1*COSTE_k-1)

    Where VAk is the link volume from an all or nothing assignment to the minimum cost paths based on COSTEk-1.

  • AAD - Average absolute volume difference: based upon successive iterations

  • RAAD - Relative AAD: DiffV/V

  • Pdiff - Percent of links whose change in V between iterations is less than a set value.

  • RMSE - Root mean squared error of the differences in V between iterations.

  • MAXITERS - Sets a fixed maximum number of iterations for convergence

The ADJUST phase process is as follows:

  • Major Link loop: Linkno = 1, NumLinks (multiple passes if equilibrium is specified):

    • Obtain link values (as in LINKREAD and LINKREAD stack, except TIME is not altered).

    • If Iteration > 1, obtain prior combined iteration volumes (CVOL is prior V).

    • Apply the appropriate TC and Cost Functions (based on LinkClass) to compute revised Time and Cost.

      Note: Note

      Unless FUNCTION COST is calculated in the Highway model, Highway will use TIME as the cost for the calculation of convergence, and for the computation of Lambda for the Frank-Wolfe algorithm (COMBINE EQUI).

    • If this is an Equilibrium pass, compute link contribution (Y) to Lambda estimations.

    • Else if Iteration > 1, combine V with prior combined Vs Process LinkAdjust stack (if present), and recompute Cost.

    • End Major Link Loop.

  • Determine if this is to be the last iteration:

    • If Iteration = MaxIters: LastIteration = 1, go to write NETO

  • Test for Convergence if CONVERGE phase not specified (true if any of following conditions met – minimum values are those set with the PARAMETERS statement):

    GAP < MinGap

    RGAP < MinRGAP

    AAD < MinAAD

    RAAD < MinRAAD

    PDIFF > MaxPdiff

    RMSE < MinRMSE

    Note: Under the default convergence criteria, convergence is considered to be achieved if ANY of the above PARAMETERS minimum values are obtained. Note that all of these PARAMETERS have default values so they do have minimum targets even though the user has not explicitly coded them. For example if you have specified PARAMETERS GAP=0.001 in order to stop further iterations beyond this value of GAP but have set no other controls, the assignment may stop after 20 iterations because the default value of MAXITERS=20 (when COMBINE = EQUI) is reached before reaching a GAP<0.001. Or, the assignment may stop in less then 20 iterations and before GAP<0.001 because one of the other PARAMETERS has reached its default minimum. In order to insure that a specific GAP value is achieved (if that is your goal) you must set all of the other convergence PARAMETERS to zero. For example:

    PARAMETERS MAXITERS=99, GAP=0.001, RELATIVEGAP=0, AAD=0, RAAD=0, RMSE=0

    Would continue performing iterations until GAP<=0.001 or 99 iterations were preformed. If you would like to specify alternate rules for when the program determines convergence is reached, this can now be achieved by using the CONVERGE phase. See CONVERGE phase for examples of specifying alternate convergence rules.

    • If PHASE=CONVERGE is present, process the stack statements in the CONVERGE Phase until BALANCE=1 or MAXITERS is reached.

    • If Convergence satisfied by BALANCE=1 (LastIteration set to Iteration, if true), or LastIteration: Write Neto.

CONVERGE phase

This phase, if specified, follows the ADJUST phase in each iteration. At the end of the ADJUST phase, the program checks if additional iterations are necessary. Convergence testing is not performed for Combine=Sum assignment or for Iteration=1. There are several tests that can be made to determine if more iterations are necessary. The default items that are used in the convergence tests are:

  • GAPk - ABS(SUML(VEk*COSTEk) – SUML(Vk-1*COSTEk-1))/ SUML( Vk-1*COSTEk-1)

    Where k is the current iteration and SUML denotes summation over the links and, if appropriate, the turning movements in the network, VEk is the equilibrium weighted volumes for iteration k and COSTEk is the cost based on the equilibrium volumes VEk.

  • RGAPk -(SUML(VEk-1*COSTEk-1) - SUML(VAk*COSTEk-1))/ SUML( VEk-1*COSTEk-1)

    Where VAkis the link volume from an all or nothing assignment to the minimum cost paths based on COSTEk-1.

  • AAD - Average absolute volume difference: based upon successive iterations

  • RAAD - Relative AAD: DiffVE/VE

  • Pdiff - Fractional portion of links whose change in VE between iterations is less than a set value.

    # of links:[ABS(V1-V2) / (V1) < PDIFFVALUE]\) / # of links: [V1 -> 0V2]

    Where V1 and V2 are the link flows of consecutive iterations.

  • RMSE - Root mean squared error of the differences in VE between iterations.

  • MAXITERS - Sets a fixed maximum number of iterations for convergence.

There are different philosophies as to what measures are best to determine if convergence has been reached, or if further assignment iterations will improve the assignment depending on the assignment method used. Some networks may never be able to reach a true balance because there is too much congestion, or there is insufficient capacity in certain parts of the network. Things can not be completely smooth because a slight adjustment in a few links may cause a large shift in a slug of traffic. Sometimes, the test statistics will begin to oscillate near the desired test limit, and may never reach a desired result.

The CONVERGE phase process is provided to allow the user to program his/her own method of setting convergence. The user can write script to determine if the desired measure has been met. When the results are satisfactory, the script should set the variable BALANCE to 1. That will indicate to the program that further iterations are not to be undertaken.

Note that if PHASE=CONVERGE is detected within the script, the standard tests are not performed; termination will be determined by the value of BALANCE after the phase is completed. If BALANCE is never set to 1, the program will continue until MAXITERS is satisfied. BALANCE is automatically set to 0 when the phase begins.

To help the user set BALANCE, various variables and functions are available.

Variables available for BALANCE

  • GAP - The GAP for the current iteration, Must be indexed GAP[ ] for previous iterations

  • RGAP - The RELATIVEGAP for the current iteration, Must be indexed for previous iterations

  • AAD - The AAD for the current iteration, Must be indexed for previous iterations

  • RAAD - The RAAD for the current iteration, Must be indexed for previous iterations

  • PDIFF - The PDIFF for the current iteration, Must be indexed for previous iterations

  • RMSE - The RMSE for the current iteration, Must be indexed for previous iterations

  • GAPCUTOFF - A variable initialized to the value Parameters GAP, may be reset anytime

  • RGAPCUTOFF - A variable initialized to the value Parameters RELATIVEGAP, may be reset anytime

  • AADCUTOFF - A variable initialized to the value Parameters AAD, may be reset anytime

  • RAADCUTOFF - A variable initialized to the value Parameters RAAD, may be reset anytime

  • PDIFFCUTOFF - A variable initialized to the value Parameters PDIFF, may be reset anytime

  • RMSECUTOFF - A variable initialized to the value Parameters RMSE, may be reset anytime

Functions available for BALANCE

  • GAPCHANGE - Function that results in change in GAP between the specified iteration (the required argument) and the previous iteration.

  • RGAPCHANGE - Function that results in change in RELATIVEGAP between the specified iteration (the required argument) and the previous iteration.

  • AADCHANGE - Function that results in change in AAD between the specified iteration (the required argument) and the previous iteration.

  • RAADCHANGE - Function that results in change in RAAD between the specified iteration (the required argument) and the previous iteration.

  • PDIFFCHANGE - Function that results in change in PDIFF between the specified iteration (the required argument) and the previous iteration.

  • RMSECHANGE - Function that results in change in RMSE between the specified iteration (the required argument) and the previous iteration.

  • GAPMIN - Function that results in the minimum GAP between the last n iterations, where n = the number of iterations to process.

  • GAPMAX - Function that results in the maximum GAP between the last n iterations, where n = the number of iterations to process.

  • GAPAVE - Function that results in the average GAP between the last n iterations, where n = the number of iterations to process.

  • GAPCHANGEMIN - Function that results in the minimum change in GAP between the last n iterations, where n = the number of iterations to process.

  • GAPCHANGEMAX - Function that results in the maximum change in GAP between the last n iterations, where n = the number of iterations to process.

  • GAPCHANGEAVE - Function that results in the average change in GAP between the last n iterations, where n = the number of iterations to process.

  • RGAPMIN - Function that results in the minimum RELATIVEGAP between the last n iterations, where n = the number of iterations to process.

  • RGAPMAX - Function that results in the maximum RELATIVEGAP between the last n iterations, where n = the number of iterations to process.

  • RGAPAVE - Function that results in the average RELATIVEGAP between the last n iterations, where n = the number of iterations to process.

  • RGAPCHANGEMIN - Function that results in the minimum change in RELATIVEGAP between the last n iterations, where n = the number of iterations to process.

  • RGAPCHANGEMAX - Function that results in the maximum change in RELATIVEGAP between the last n iterations, where n = the number of iterations to process.

  • RGAPCHANGEAVE - Function that results in the average change in RELATIVEGAP between the last n iterations, where n = the number of iterations to process.

  • AADMIN - Function that results in the minimum AAD between the last n iterations, where n = the number of iterations to process.

  • AADMAX - Function that results in the maximum AAD between the last n iterations, where n = the number of iterations to process.

  • AADAVE - Function that results in the average AAD between the last n iterations, where n = the number of iterations to process.

  • AADCHANGEMIN - Function that results in the minimum change in AAD between the last n iterations, where n = the number of iterations to process.

  • AADCHANGEMAX - Function that results in the maximum change in AAD between the last n iterations, where n = the number of iterations to process.

  • AADCHANGEAVE - Function that results in the average change in AAD between the last n iterations, where n = the number of iterations to process.

  • RAADMIN - Function that results in the minimum RAAD between the last n iterations, where n = the number of iterations to process.

  • RAADMAX - Function that results in the maximum RAAD between the last n iterations, where n = the number of iterations to process.

  • RAADAVE - Function that results in the average RAAD between the last n iterations, where n = the number of iterations to process.

  • RAADCHANGEMIN - Function that results in the minimum change in RAAD between the last n iterations, where n = the number of iterations to process.

  • RAADCHANGEMAX - Function that results in the maximum change in RAAD between the last n iterations, where n = the number of iterations to process.

  • RAADCHANGEAVE - Function that results in the average change in RAAD between the last n iterations, where n = the number of iterations to process.

  • PDIFFMIN - Function that results in the minimum PDIFF between the last n iterations, where n = the number of iterations to process.

  • PDIFFMAX - Function that results in the maximum PDIFF between the last n iterations, where n = the number of iterations to process.

  • PDIFFAVE - Function that results in the average PDIFF between the last n iterations, where n = the number of iterations to process.

  • PDIFFCHANGEMIN - Function that results in the minimum change in PDIFF between the last n iterations, where n = the number of iterations to process.

  • PDIFFCHANGEMAX - Function that results in the maximum change in PDIFF between the last n iterations, where n = the number of iterations to process.

  • PDIFFCHANGEAVE - Function that results in the average change in PDIFF between the last n iterations, where n = the number of iterations to process.

  • RMSEMIN - Function that results in the minimum RMSE between the last n iterations, where n = the number of iterations to process.

  • RMSEMAX - Function that results in the maximum RMSE between the last n iterations, where n = the number of iterations to process.

  • RMSEAVE - Function that results in the average RMSE between the last n iterations, where n = the number of iterations to process.

  • RMSECHANGEMIN - Function that results in the minimum change in RMSE between the last n iterations, where n = the number of iterations to process.

  • RMSECHANGEMAX - Function that results in the maximum change in RMSE between the last n iterations, where n = the number of iterations to process.

  • RMSECHANGEAVE - Function that results in the average change in RMSE between the last n iterations, where n = the number of iterations to process.

Example

PHASE=CONVERGE
  IF (ITERATION < 6) BREAK; Do not even test for
 Iterations 2-5
 IF (GAP < GAPCUTOFF)
 BALANCE = 1
 BREAK
  ENDIF
 IF (GAPCHANGEAVE(3) < 0.006 && GAPCHANGEMAX(3) < 0.009 &&
 ABS(GAPCHANGEMIN) < 0.009) BALANCE = 1
 ENDPHASE

Example

; This example implements the opposite of the default stopping criteria which is to stop if ANY of the convergence measures go below the values specified on the PARAMETERS statement. In this example the assignment would stop only when ALL criteria fall below their specified values.
PHASE=CONVERGE
 IF (GAP<GAPCUTOFF & RGAP<RGAPCUTOFF & AAD<AADCUTOFF &
RAAD<RAADCUTOFF & RMSE<RMSECUTOFF & PDIFF<PDIFFCUTOFF)
BALANCE = 1
 ENDIF
ENDPHASE